<?php

/**
 * Photos form.
 *
 * @package    jobeet
 * @subpackage form
 * @author     Your name here
 */
class PhotosForm extends BasePhotosForm
{
  public function configure()
  {
    $this->widgetSchema['file'] = new sfWidgetFormInputFileEditable(array(
                                                                'file_src' => '/uploads/photos/'.$this->getObject()->getFile(),
                                                                'is_image' => true,
                                                                'edit_mode' => !$this->isNew(),
                                                                'delete_label' => 'Удалить текущее изображение',
                                                                'template'  => '<div>%file%<br />%input%<br />%delete% %delete_label%</div>',));

    $this->validatorSchema['file'] = new sfValidatorFile(array(
                                                    'mime_types' => 'web_images',
                                                    'path' => sfConfig::get('sf_upload_dir').'/photos',
                                                    'required' => false,
                                                    ));
    $this->validatorSchema['file_delete'] = new sfValidatorPass();
  }
}
